package com.ruoyi.ai.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.ai.mapper.AiCategoryMapper;
import com.ruoyi.ai.domain.AiCategory;
import com.ruoyi.ai.service.IAiCategoryService;

/**
 * 分类Service业务层处理
 * 
 * @author tang
 * @date 2024-12-09
 */
@Service
public class AiCategoryServiceImpl implements IAiCategoryService 
{
    @Autowired
    private AiCategoryMapper aiCategoryMapper;

    /**
     * 查询分类
     * 
     * @param categoryId 分类主键
     * @return 分类
     */
    @Override
    public AiCategory selectAiCategoryByCategoryId(Long categoryId)
    {
        return aiCategoryMapper.selectAiCategoryByCategoryId(categoryId);
    }

    /**
     * 查询分类列表
     * 
     * @param aiCategory 分类
     * @return 分类
     */
    @Override
    public List<AiCategory> selectAiCategoryList(AiCategory aiCategory)
    {
        return aiCategoryMapper.selectAiCategoryList(aiCategory);
    }

    /**
     * 新增分类
     * 
     * @param aiCategory 分类
     * @return 结果
     */
    @Override
    public int insertAiCategory(AiCategory aiCategory)
    {
        aiCategory.setCreateTime(DateUtils.getNowDate());
        return aiCategoryMapper.insertAiCategory(aiCategory);
    }

    /**
     * 修改分类
     * 
     * @param aiCategory 分类
     * @return 结果
     */
    @Override
    public int updateAiCategory(AiCategory aiCategory)
    {
        aiCategory.setUpdateTime(DateUtils.getNowDate());
        return aiCategoryMapper.updateAiCategory(aiCategory);
    }

    /**
     * 批量删除分类
     * 
     * @param categoryIds 需要删除的分类主键
     * @return 结果
     */
    @Override
    public int deleteAiCategoryByCategoryIds(Long[] categoryIds)
    {
        return aiCategoryMapper.deleteAiCategoryByCategoryIds(categoryIds);
    }

    /**
     * 删除分类信息
     * 
     * @param categoryId 分类主键
     * @return 结果
     */
    @Override
    public int deleteAiCategoryByCategoryId(Long categoryId)
    {
        return aiCategoryMapper.deleteAiCategoryByCategoryId(categoryId);
    }
}
